﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using SaleStat.BLL.PM;
using SaleStat.COM.Exceptions;
public partial class PmInfo_Detail : BasePage
{
    #region 初始化
    /// <summary>
    /// 初始化
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                //获取产品ID
                string strCpID = Request["CpID"].ToString();
                getProductSaleInfo(strCpID);
                imgBtnClose.Focus();
            }
        }
        catch (Exception ex)
        {
            CloseWinWithException(ex);

        }
    }
    #endregion

    #region 检索产品信息
    /// <summary>
    /// 检索产品信息
    /// </summary>
    /// <param name="strCpID"></param>
    public void getProductSaleInfo(string strCpID)
    {
        PM_Edit_BLL PM_ListService = new PM_Edit_BLL();
        DataTable dtProductSaleInfo = new DataTable();
        dtProductSaleInfo = PM_ListService.getProductInfo(strCpID);
        if (dtProductSaleInfo == null || dtProductSaleInfo.Rows.Count == 0)
        {
            throw new BusinessException("产品信息不存在!");

        }
        txtCpID.Text = dtProductSaleInfo.Rows[0]["ProductID"].ToString();
        txtSalesName.Text = dtProductSaleInfo.Rows[0]["ProducTypeName"].ToString();
        txtGuige.Text = dtProductSaleInfo.Rows[0]["ProducGuiGe"].ToString();
        lblDanWei.Text = dtProductSaleInfo.Rows[0]["ProducUnit"].ToString();
        TxtStoreDate.Text = dtProductSaleInfo.Rows[0]["StoreDate"].ToString();
        txtNote.Text = dtProductSaleInfo.Rows[0]["Note"].ToString();
        


    }
    #endregion

}